#ifndef DELETECUSTOMCLASSES_H_
#define DELETECUSTOMCLASSES_H_


//#include "behaviour.h"
#include "events.h"
#include "actions.h"
#include "allBehaviours.h"




class DeleteCustomClass
{
protected:
	static void deleteBehaviour(Behaviour* _behaviour)
	{
		switch (_behaviour->getBehaviourType())
		{
			case BehaviourTypes::FLEE:
				delete ((Flee*)_behaviour);
			break;
		default:
			delete _behaviour;
		}


	}

	static void deleteAction(Action* _action)
	{
		switch (_action->actionType)
		{
		case ActionTypes::GOTOLOCATION:
			delete ((GotoLocation*)_action);
		break;

		default:
			delete _action;
		}


	}

	static void deleteEvent(Event* _event)
	{

		switch (_event->eventType)
		{
			case EventTypes::enemyEntersRadius:
				delete ((enemyEntersRadius_e*)_event);
			break;
			case EventTypes::shootsAt:
				delete ((shootsAt_e*)_event);
			break;

			default:
				delete _event;

		}
	}


public:
	static void Delete(Behaviour* _behaviour)
	{
		if (_behaviour == NULL)
			return;
		deleteBehaviour(_behaviour);
	}

	static void Delete(Action* _action)
	{
		if (_action == NULL)
			return;
		deleteAction(_action);
	}

	static void Delete(Event* _event)
	{
		if (_event == NULL)
			return;
		deleteEvent(_event);
	}




};



#endif